package rensoft.portfolio.client.view.viewer;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Widget;

import rensoft.gwt.client.view.View;
import rensoft.portfolio.client.lib.view.ButtonBehavior;
import rensoft.portfolio.client.model.titles.Titles;
import rensoft.portfolio.client.model.titles.Titles.TitleState;

public class CloseHandle extends View<Widget> implements ClickHandler {

  static Binder uiBinder = GWT.create(Binder.class);

  public CloseHandle() {
    initWidget(uiBinder.createAndBindUi(this));
    addClickHandler(this);
    new ButtonBehavior(this);
  }

  public void onClick(ClickEvent event) {
    get(Titles.class).open(TitleState.closed);
  }

  interface Binder extends UiBinder<Widget, CloseHandle> {}
}
